FOR /F "skip=2 tokens=3" %%i in ('REG QUERY "HKLM\SOFTWARE\Microsoft\net framework setup\ndp\v4\client" /v version') DO set FRAMEWORK=%%i

%windir%\Microsoft.NET\Framework\v%FRAMEWORK%\MSBuild.exe /t:Build /p:Configuration=Debug;TargetFrameworkVersion=v%FRAMEWORK% Dwarfs.sln

pause